var mongoose =require('mongoose');
var Schema = mongoose.Schema;

var Faction = new Schema({
    name: {type: String},
    description: {type: String},
    creator: {type: Schema.Types.ObjectId, ref: 'User'},
    tags: [{type: Schema.Types.Mixed}], // 标签

    logo: {type: String},// logo
    weight: {type: Number, default: 1}, // 权重
    memberCount: {type: Number, default: 1}, // 成员数
    members: [{type: Schema.Types.Mixed}], //TODO: abandoned
    actCount: {type: Number, default: 0},
    activites: [{type: Schema.Types.Mixed}], // 活动
    topicCount: {type: Number, default: 0},
    topics: [{type: Schema.Types.Mixed}], // 话题
    creditspolicy: {type: Schema.Types.ObjectId, ref: 'Creditspolicy'},// 积分策略
    creatTime: {type: Date, default: Date.now},
    isDelete: {type:Boolean, default: false}// 删除
})

mongoose.model('Faction', Faction);